home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / grafik / raytracing / rayshade-4.0.6.3 / inetray / inetray_svc.c < prev    next >
C/C++ Source or Header  |  1993-08-17  |  2KB  |  115 lines

  1. /*
  2.  * Please do not edit this file.
  3.  * It was generated using rpcgen.
  4.  */
  5.  
  6. #include <stdio.h>
  7. #include <rpc/rpc.h>
  8. #include <sys/socket.h>
  9. #include <syslog.h>
  10. #include "inetray.h"
  11.  
  12. #ifdef DEBUG
  13. #define RPC_SVC_FG
  14. #endif
  15. #include    <sys/param.h>
  16. #ifndef ITIMER_REAL
  17. #include    <sys/time.h>        /* for A/UX */
  18. #endif
  19. #include    "config.h"
  20.  
  21. extern int _rpcpmstart;        /* Started by a port monitor ? */
  22. extern int _rpcfdtype;        /* Whether Stream or Datagram ? */
  23.  
  24. void
  25. inetray_1(rqstp, transp)
  26.     struct svc_req *rqstp;
  27.     register SVCXPRT *transp;
  28. {
  29.     union {
  30.         iPrm init_1_arg;
  31.         sfPrm startframe_1_arg;
  32.         tbPrm traceblock_1_arg;
  33.         int kill_1_arg;
  34.         int wait_1_arg;
  35.         int terminate_1_arg;
  36.     } argument;
  37.     char *result;
  38.     bool_t (*xdr_argument)(), (*xdr_result)();
  39.     char *(*local)();
  40.  
  41.     switch (rqstp->rq_proc) {
  42.     case NULLPROC:
  43.         (void) svc_sendreply(transp, xdr_void, (char *)NULL);
  44.         return;
  45.  
  46.     case INIT:
  47.         xdr_argument = xdr_iPrm;
  48.         xdr_result = xdr_void;
  49.         local = (char *(*)()) init_1;
  50.         break;
  51.  
  52.     case STARTFRAME:
  53.         xdr_argument = xdr_sfPrm;
  54.         xdr_result = xdr_int;
  55.         local = (char *(*)()) startframe_1;
  56.         break;
  57.  
  58.     case TRACEBLOCK:
  59.         xdr_argument = xdr_tbPrm;
  60.         xdr_result = xdr_void;
  61.         local = (char *(*)()) traceblock_1;
  62.         break;
  63.  
  64.     case KILL:
  65.         xdr_argument = xdr_int;
  66.         xdr_result = xdr_int;
  67.         local = (char *(*)()) kill_1;
  68.         break;
  69.  
  70.     case WAIT:
  71.         xdr_argument = xdr_int;
  72.         xdr_result = xdr_int;
  73.         local = (char *(*)()) wait_1;
  74.         break;
  75.  
  76.     case TERMINATE:
  77.         xdr_argument = xdr_int;
  78.         xdr_result = xdr_void;
  79.         local = (char *(*)()) terminate_1;
  80.         break;
  81.  
  82.     default:
  83.         svcerr_noproc(transp);
  84.         return;
  85.     }
  86.     bzero((char *)&argument, sizeof(argument));
  87.     if (!svc_getargs(transp, xdr_argument, &argument)) {
  88.         svcerr_decode(transp);
  89.         return;
  90.     }
  91.     result = (*local)(&argument, rqstp);
  92.     if (result != NULL && !svc_sendreply(transp, xdr_result, result)) {
  93.         svcerr_systemerr(transp);
  94.     }
  95.     if (!svc_freeargs(transp, xdr_argument, &argument)) {
  96.         _msgout("unable to free arguments");
  97.         exit(1);
  98.     }
  99.     return;
  100. }
  101.  
  102. static
  103. _msgout(msg)
  104.     char *msg;
  105. {
  106. #ifdef RPC_SVC_FG
  107.     if (_rpcpmstart)
  108.         syslog(LOG_ERR, msg);
  109.     else
  110.         (void) fprintf(stderr, "%s\n", msg);
  111. #else
  112.     syslog(LOG_ERR, msg);
  113. #endif
  114. }
  115.